<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link rel="stylesheet" href="../assets/css/layui.css">
    <link rel="stylesheet" href="../assets/css/view.css"/>
    <script src="../assets/echarts.min.js"></script>
    <script src="../../qrcode/jquery2.1.4.js"></script>
    <title></title>
</head>
<body class="layui-view-body">
    <div class="layui-content">
        <div class="layui-row layui-col-space20">
            <div class="layui-col-sm6 layui-col-md6">
                <div class="layui-card">
                    <div class="layui-card-body chart-card">
                        <div class="chart-header">
                            <div class="metawrap">
                                <div class="meta">
                                    <span>用户人数</span>
                                </div>
                                <div class="total" id="userCount">-</div>
                            </div>
                        </div>
                        <div class="chart-body">
                            <div class="contentwrap">
                            </div>
                        </div>
                        <div class="chart-footer">
                            <div class="field">
                                <span>日注册量</span>
                                <span id="userDayRegCount">-</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-col-sm6 layui-col-md6">
                <div class="layui-card">
                    <div class="layui-card-body chart-card">
                        <div class="chart-header">
                            <div class="metawrap">
                                <div class="meta">
                                    <span>快递员人数</span>
                                </div>
                                <div class="total" id="courierNumber">-</div>
                            </div>
                        </div>
                        <div class="chart-body">
                            <div class="contentwrap">
                            </div>
                        </div>
                        <div class="chart-footer">
                            <div class="field">
                                <span>日注册量</span>
                                <span id="regDayNumber_2">-</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-col-sm6 layui-col-md6">
                <div class="layui-card">
                    <div class="layui-card-body chart-card">
                        <div class="chart-header">
                            <div class="metawrap">
                                <div class="meta">
                                    <span>总快件数</span>
                                </div>
                                <div id="express_total" class="total">-</div>
                            </div>
                        </div>
                        <div class="chart-body">
                            <div class="contentwrap">
                            </div>
                        </div>
                        <div class="chart-footer">
                            <div class="field">
                                <span>今日派单量</span>
                                <span id="day_delivery_number">-</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-col-sm6 layui-col-md6">
                <div class="layui-card">
                    <div class="layui-card-body chart-card">
                        <div class="chart-header">
                            <div class="metawrap">
                                <div class="meta">
                                    <span>待取件数</span>
                                </div>
                                <div id="await_express_number" class="total">-</div>
                            </div>
                        </div>
                        <div class="chart-body">
                            <div class="contentwrap">
                            </div>
                        </div>
                        <div class="chart-footer">
                            <div class="field">
                                <span>今日新增</span>
                                <span id="day_increase_number">-</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script src="../assets/layui.all.js"></script>
    <script>
     var element = layui.element;
    </script>
    <script>
        $(function(){
           //1.    ajax与服务器交互
            $.post("/user/consoleUser.do",null,function(data){
                if(data.status == 0){//表示没有出现错误
                    //[{size:总数,day:新增},{size:总数,day:新增}]
                    $("#userCount").html(data.data.userCount);
                    $("#userDayRegCount").html(data.data.userDayRegCount);
                }
            },"JSON");
            $.post("/courier/consoleCourier.do",null,function(data){
                if(data.status == 0){//表示没有出现错误
                    //[{size:总数,day:新增},{size:总数,day:新增}]
                    $("#courierNumber").html(data.data.courierCount);
                    $("#regDayNumber_2").html(data.data.dayRegCount);
                }
            },"JSON");
           $.post("/express/consoleExpress.do",null,function(data){
                if(data.status == 0){//表示没有出现错误
                    //返回的数据格式：[{size:总数,day:新增},{size:总数,day:新增}]
                    //express_total day_delivery_number await_express_number day_increase_number
                    $("#express_total").html(data.data.expressTotal);
                    $("#day_delivery_number").html(data.data.dayDeliveryCount);
                    $("#await_express_number").html(data.data.awaitExpressTotal);
                    $("#day_increase_number").html(data.data.dayIncreaseCount);
                }
           },"JSON");
        });
    </script>
</body>
</html>